<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <p>{{num}}</p>
      <p v-if="bol">{{list}}</p>
      <button @click="btnClick">点我啊</button>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          num: 0,
          list: [1, 2, 3, 4, 5, 6],
          bol: true,
        },
        methods: {
          btnClick() {
            this.list[1] = Date.now();
            this.bol = false;
            this.$nextTick(() => {
              this.bol = true;
            });

            // setTimeout(() => {
            //   window.console.log(1);
            // }, 0);
            // window.console.log(2);
            // this.$nextTick(() => {
            //   window.console.log(3);
            // });
            // 2  1  3
          },
        },
      });
    </script>
  </body>
</html>
